home *** CD-ROM | disk | FTP | other *** search
/ Clickx 31 / Clickx 31.iso / assets / software / MyServer-win32-0.8.2.exe / web / downloads / phpinfo.php < prev    next >
Encoding:
PHP Script  |  2006-01-16  |  2.1 KB  |  67 lines

  1. <?php
  2. if(isset($_GET['showsource']))
  3. {
  4.     show_source(__FILE__);
  5. }
  6. else
  7. {
  8.     print ('<?xml version="1.0" encoding="UTF-8" ?>');
  9.     print ("\n".'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"'."\n".'"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n");
  10.     print ('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  11.     <head>
  12.     <title>MyServer - phpinfo() PHP Example</title>
  13.     <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  14.     <style type="text/css">
  15.     body {background-color: #ffffff; color: #666699;}
  16.     body, td, th, h1, h2 {font-family: verdana,arial,helvetica,tahoma,sans-serif;}
  17.     pre {margin: 0px; font-family: monospace;}
  18.     a {color: #666699;}
  19.     a:link {color: #666699; text-decoration: none; background-color: #ffffff;}
  20.     a:hover {text-decoration: underline;}
  21.     table {border-collapse: collapse;}
  22.     .center {text-align: center;}
  23.     .center table {margin-left: auto; margin-right: auto; text-align: left;}
  24.     .center th {text-align: center !important;}
  25.     .right {text-align: right;}
  26.     td, th { border: 1px solid #666699; font-size: 75%; vertical-align: baseline;}
  27.     h1 {font-size: 150%;}
  28.     h2 {font-size: 125%;}
  29.     .p {text-align: left;}
  30.     .e {background-color: #666699; font-weight: bold; color: #ffffff;}
  31.     .h {background-color: #666699; font-weight: bold; color: #ffffff;}
  32.     .v {background-color: #ffffff; color: #666699;}
  33.     i {color: #ffffff; background-color: #666699;}
  34.     img {float: right; border: 0px;}
  35.     hr {width: 600px; background-color: #666699; border: 0px; height: 1px; color: #666699;}
  36.     </style>
  37.     <div class="center">');
  38.  
  39.  
  40.     if($_SERVER['REMOTE_ADDR']== "127.0.0.1")
  41.     {
  42.         ob_start();
  43.         phpinfo();
  44.         $php_info = ob_get_contents();
  45.         ob_end_clean();
  46.         $php_info    = str_replace(" width=\"600\"", " width=\"600\"", $php_info);
  47.         $php_info    = str_replace("</body></html>", "", $php_info);
  48.         $offset      = strpos($php_info, "<table");
  49.         print('<div class="right">
  50.         <small>
  51.         <a href="?showsource" style="text-decoration: none;">Show Source</a>
  52.         </small>
  53.         </div>');
  54.         print substr($php_info, $offset);
  55.     }
  56.  
  57.     else
  58.     {
  59.         print "This page is only accessible locally!";
  60.     }
  61.  
  62.     print('
  63.     </div>
  64.     </body>
  65.     </html>');
  66. }
  67. ?>